﻿<UserControl x:Class="Sidvall.UI.Wpf.Controls.PingFederateIdentityProviderControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters" 
    xmlns:Controls="clr-namespace:Sidvall.UI.Wpf.Controls"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:vms="clr-namespace:Sidvall.UI.ViewModels;assembly=Sidvall.UI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d" 
    d:DesignHeight="220" d:DesignWidth="600">

    <UserControl.Resources>
        <Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
        <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter2" Not="True" />
    </UserControl.Resources>

    <Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:PingFederateIdentityProviderControlViewModel}}">
        <Grid IsEnabled="{Binding IsBusy, Converter={StaticResource InverseBooleanConverter}}" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel>
                    <StackPanel Margin="8">
                        <TextBlock Text="User name"/>
                        <TextBox x:Name="UserNameBox" Grid.Column="1" Text="{Binding UserName, UpdateSourceTrigger=PropertyChanged}" VerticalContentAlignment="Center" 
                                         Height="30" Padding="5,0" />
                    </StackPanel>
                    <StackPanel Margin="8">
                        <TextBlock Text="Password"/>
                        <PasswordBox x:Name="PasswordBox" Grid.Column="1" VerticalContentAlignment="Center" Height="30" Padding="5,0" />
                    </StackPanel>
                </StackPanel>

                <Grid Grid.Row="1" Grid.ColumnSpan="2" Background="#FFF0F0F0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <StackPanel Grid.Column="0" Orientation="Horizontal" Margin="8">
                        <Button MinWidth="70" Padding="15,3,15,3" Content="Back" Click="GoBack_Click" />
                    </StackPanel>
                    <StackPanel Grid.Column="4" Orientation="Horizontal" Margin="0,8,8,8">
                        <Button x:Name="LogOnButton" MinWidth="70" Padding="15,3,15,3" Margin="8,0,0,0" IsEnabled="{Binding CanLogOn, Mode=OneWay}" 
                                        Content="Log on" Click="LogOn_Click" />
                    </StackPanel>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
